import { FC, ReactNode } from 'react';
import { Spin } from 'antd';
import classNames from 'classnames';

import './index.less';

export type ContentProps = {
  children: ReactNode;

  /**
   * 加载状态
   * @default false
   */
  loading?: boolean;

  /** 类名 */
  className?: string;
};

const Content: FC<ContentProps> = ({ children, className, loading = false }) => {
  return (
    <Spin spinning={loading}>
      <div className={classNames('rb-page-content-div-wapper', className)}>{children}</div>
    </Spin>
  );
};

export default Content;
